public class ProxyUser {
    private User Proxy;

    public ProxyUser(User user) {
        this.Proxy = user;
    }
    public void menu(){
        this.Proxy.menu();
    }

    public void borrowBook(String bookName) {
        System.out.println("Proxy: 检查⽤⼾权限 ");
        if (Proxy instanceof NormalUser) {
            ((NormalUser) Proxy).borrow(bookName);
        } else if (Proxy instanceof AdminUser) {
            System.out.println(" 您没有权限借阅书籍，请以普通⽤⼾的⽅式借阅书籍");
        }
    }

    public void addBook(String bookName) {
        System.out.println("Proxy: 检查书本状态 ");
        if (Proxy instanceof NormalUser) {
            System.out.println(" 您没有权限上架书籍，请以管理员⽤⼾的⽅式上架书籍 ");
        } else if (Proxy instanceof AdminUser) {
            ((AdminUser) Proxy).manage(bookName);
        }

    }
}
